package app.fugema.shop.main.order.adapter;

import android.view.View;

import com.base.common.view.adapter.ada.GeneralRecyclerAdapter;
import com.base.common.view.adapter.connector.BaseUniversalItemMultiType;

import androidx.lifecycle.LifecycleOwner;
import app.fugema.shop.R;
import app.fugema.shop.main.order.model.OrderExpressResult;
import app.fugema.shop.main.order.view.DeliveryCheckDetailActivity;
import app.fugema.shop.main.order.vm.OrderListVM;

public class GroupOrderDetailAdapter extends GeneralRecyclerAdapter
{
    private OrderListVM orderListVM;

    public GroupOrderDetailAdapter(LifecycleOwner lifecycleOwner, OrderListVM orderListVM)
    {
        this.lifecycleOwner = lifecycleOwner;
        this.orderListVM = orderListVM;
        init();
    }

    @Override
    public void initMultiItemType()
    {

        putMultiItemType( new GroupOrderPeopleMultiType() );
        //物流信息
        putMultiItemType(new BaseUniversalItemMultiType<OrderExpressResult>(R.layout.shopping_delivery_check_item) {
            @Override
            public int getItemViewType() {
                return TYPE_HEAD_ONE;
            }

            @Override
            public void onItemClick(View view, int onclickType, int position, OrderExpressResult bean) {
                super.onItemClick(view, onclickType, position, bean);
                DeliveryCheckDetailActivity.start(view.getContext(), "bean");
            }
        });

        putMultiItemType(new OrderAddrMultiType());
        putMultiItemType(new OrderDetailGoodsItemMultiType(lifecycleOwner, orderListVM));
        //订单时间支付方式
        putMultiItemType(new OrderFooterMultiType());

    }

}
